<?php

function fnMstUser() {
    $results = mysql_query("SELECT	
                                Nama,
                                Alamat,
                                Telepon,
                                Email,
                                Sts_Admin
                                Login,
                                Password
                            FROM
                                mst_user");
    return $results;
}
function fnInsertUser($Nama,$Alamat,$Telp,$Email) {
  $result = mysql_query("INSERT INTO mst_user 
                          	(Nama,Alamat,Telepon,Email)
                         VALUES
                          	('$Nama','$Alamat','$Telp','$Email')
                         ");
  return $result;
}

function fnUpdateUser($Id,$Nama,$Alamat,$Telp,$Email) {
  $result = mysql_query("UPDATE mst_user SET 
                              	Nama = '$Nama',
                              	Alamat = '$Alamat',
                              	Telepon = '$Telp',
                              	Email = '$Email'
                         WHERE Id = $Id");
  return $result;
}

function fnDeleteUser($Id) {
  $result = mysql_query("DELETE FROM mst_user 
                         WHERE Id = $Id");
  return $result;
}

function fnLogin($LoginId, $Password) {
    $results = mysql_query("SELECT * FROM mst_user WHERE login='".$LoginId."' and password='".$Password."'");
    return $results;
}

?>
